package com.akupilih.app.adapter;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.akupilih.app.ElectabilitasChartFragment;
import com.akupilih.app.PeopleTalkChartFragment;
import com.akupilih.app.SocialMediaBarChartFragment;
import com.akupilih.app.TotalTalkChartFragment;
import com.akupilih.app.TrendChartFragment;

public class StatistikAdapter extends FragmentPagerAdapter {

	final int PAGE_COUNT = 5;
	private final String[] TITLES = { "Trend Chart","Share of Awareness", "Elektabilitas", "Share of Citizen", "Social Media Trend"};
	
	public StatistikAdapter(FragmentManager fragmentManager) {
		super(fragmentManager);
		// TODO Auto-generated constructor stub
		
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return PAGE_COUNT;
	}
	
	@Override
	public CharSequence getPageTitle(int position) {
		// TODO Auto-generated method stub
		return TITLES[position];
	}

	@Override
	public Fragment getItem(int arg0) {
		Bundle data = new Bundle();
		switch (arg0) {

		/** tab1 is selected */
		case 0:
			TrendChartFragment fragment1 = new TrendChartFragment();
			return fragment1;

			/** tab2 is selected */
		case 1:
			TotalTalkChartFragment fragment2 = new TotalTalkChartFragment();
			return fragment2;
		case 2:
			ElectabilitasChartFragment fragment3 = new ElectabilitasChartFragment();
			return fragment3;

		case 3:
			PeopleTalkChartFragment fragment4 = new PeopleTalkChartFragment();
			return fragment4;
		case 4:
			SocialMediaBarChartFragment fragment5 = new SocialMediaBarChartFragment();
			return fragment5;
		}
		return null;
	}

}
